package pantallas;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.CellRendererPane;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class RecomendarUbicacionView extends javax.swing.JFrame {
	private JLabel lblMapaLocal;
	private JTable tMapaLocal;
	private JButton cmdReserva;
	private JButton cmdCancelar;
	private JButton cmdAceptar;
	private JComboBox cmbSeleccionarUbicacioin;
	private JLabel lblUbicacion;
	private JTextField txtCantidadCubiertos;
	private JLabel lblCantidadCubiertos;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				RecomendarUbicacionView inst = new RecomendarUbicacionView();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
				inst.getContentPane().setLayout(null);
				inst.setSize(619, 460);
			}
		});
	}
	
	public RecomendarUbicacionView() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			pack();
			this.setSize(900, 500);
			setTitle("Recomendar Mesa");
			getContentPane().setLayout(null);
			{
				lblMapaLocal = new JLabel();
				getContentPane().add(lblMapaLocal);
				lblMapaLocal.setText("Mapa del Local");
				lblMapaLocal.setBounds(14, 28, 245, 14);
			}
			{
				tMapaLocal = new JTable(20,20);
				getContentPane().add(tMapaLocal);
				tMapaLocal.setBounds(14, 49, 406, 336);
				
			}
			{
				lblCantidadCubiertos = new JLabel();
				getContentPane().add(lblCantidadCubiertos);
				lblCantidadCubiertos.setText("Cantidad de Cubiertos");
				lblCantidadCubiertos.setBounds(548, 81, 203, 14);
			}
			{
				txtCantidadCubiertos = new JTextField();
				getContentPane().add(txtCantidadCubiertos);
				txtCantidadCubiertos.setBounds(548, 101, 115, 21);
			}
			{
				lblUbicacion = new JLabel();
				getContentPane().add(lblUbicacion);
				lblUbicacion.setText("Ubicacion");
				lblUbicacion.setBounds(548, 128, 245, 14);
			}
			{
				ComboBoxModel cmbSeleccionarUbicacioinModel = 
						new DefaultComboBoxModel(
								new String[] {"Mesa 4, Mesa 5", "Mesa 5, Mesa 8, Mesa 9", "Mesa 10, Mesa 12, Mesa 16"});
				cmbSeleccionarUbicacioin = new JComboBox();
				getContentPane().add(cmbSeleccionarUbicacioin);
				cmbSeleccionarUbicacioin.setModel(cmbSeleccionarUbicacioinModel);
				cmbSeleccionarUbicacioin.setBounds(548, 154, 252, 21);
			}
			{
				cmdAceptar = new JButton();
				getContentPane().add(cmdAceptar);
				cmdAceptar.setText("Aceptar");
				cmdAceptar.setBounds(592, 416, 119, 21);
				cmdAceptar.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						System.out.println("cmdAceptar.actionPerformed, event="+evt);
						JOptionPane.showMessageDialog(null, "Imposible ubicar cubiertos. No se dispone de la suficente cantidad de mesas libres.");
					}
				});
			}
			{
				cmdCancelar = new JButton();
				getContentPane().add(cmdCancelar);
				cmdCancelar.setText("Cancelar");
				cmdCancelar.setBounds(733, 413, 119, 21);
			}
			{
				cmdReserva = new JButton();
				getContentPane().add(cmdReserva);
				cmdReserva.setText("Utilizar Reserva");
				cmdReserva.setBounds(548, 49, 245, 21);
			}
			//MEDIDAS Y CENTRALIZACION DE LA PANTALLA.
	        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
	        int w = this.getSize().width;
	        int h = this.getSize().height;
	        int x = (dim.width-w)/2;
	        int y = (dim.height-h)/2;
	        this.setLocation(x, y);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
